import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AiChatVO, AiChatForm, AiChatQuery } from '@/api/nursing/aiChat/types';

/**
 * 查询AI聊天列表
 * @param query
 * @returns {*}
 */

export const listAiChat = (query?: AiChatQuery): AxiosPromise<AiChatVO[]> => {
  return request({
    url: '/nursing/aiChat/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询AI聊天详细
 * @param id
 */
export const getAiChat = (id: string | number): AxiosPromise<AiChatVO> => {
  return request({
    url: '/nursing/aiChat/' + id,
    method: 'get'
  });
};

/**
 * 新增AI聊天
 * @param data
 */
export const addAiChat = (data: AiChatForm) => {
  return request({
    url: '/nursing/aiChat',
    method: 'post',
    data: data
  });
};

/**
 * 修改AI聊天
 * @param data
 */
export const updateAiChat = (data: AiChatForm) => {
  return request({
    url: '/nursing/aiChat',
    method: 'put',
    data: data
  });
};

/**
 * 删除AI聊天
 * @param id
 */
export const delAiChat = (id: string | number | Array<string | number>) => {
  return request({
    url: '/nursing/aiChat/' + id,
    method: 'delete'
  });
};
